<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body{
      width: 100%;
      height: 100vh;
      overflow: hidden;
      background: url('./images/1.jpg') no-repeat;
    }
    ul{
      padding: 10px 0;
      list-style: none;
      margin: 100px auto;
      width: 680px;
      background: #fff;
      border: 1px solid #333;
      overflow: hidden;
    }
    li{
      float: left;
      width: 150px;
      height: 80px;
      margin: 0 10px;
    }
    img{
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
  <ul>
    <li><img src="./images/1.jpg" alt=""></li>
    <li><img src="./images/2.jpg" alt=""></li>
    <li><img src="./images/3.jpg" alt=""></li>
    <li><img src="./images/4.jpg" alt=""></li>
  </ul>

  <script>
    var imgs = document.querySelectorAll('img')

    for(var i = 0; i < imgs.length; i++) {
      imgs[i].onclick = function() {
        // console.log(this.src)
        document.body.style.background = 'url(' + this.src + ')'
      }
    }
  </script>
</body>
</html>